<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Creating a 3D Cube</title>
  <style>
    body {
      margin: 75px 0 0 75px;
    }

    #wrapper {
      perspective: 500px;
    }

    #the-cube {
      transform-style: preserve-3d;
    }

    #the-cube div {
      position: absolute;
      width: 150px;
      height: 150px;
      border: thin solid black;
      background-color: rgba(200, 200, 200, 0.5);
      font-size: 125%;
      font-weight: bold;
      line-height: 125px;
      text-align: center;
    }

    .front {
      transform: translateZ(75px);
    }

    .back {
      transform: rotateY(180deg) translateZ(75px);
    }

    .right {
      transform: rotateY(90deg) translateZ(75px);
    }

    .left {
      transform: rotateY(-90deg) translateZ(75px);
    }

    .top {
      transform: rotateX(90deg) translateZ(75px);
    }

    .bottom {
      transform: rotateX(-90deg) translateZ(75px);
    }
  </style>
</head>
<body>
  <div id="wrapper">
    <div id="the-cube">
      <div class="front">FRONT</div>
      <div class="back">BACK</div>
      <div class="left">LEFT</div>
      <div class="right">RIGHT</div>
      <div class="top">TOP</div>
      <div class="bottom">BOTTOM</div>
    </div>
  </div>
</body>
</html>
